import request from '@/utils/request'

/**
 * 登陆系统
 * @param user 用户信息
 * @returns {AxiosPromise}
 */
export function login(user) {
  return request({
    url: '/service-user/user/login',
    method: 'post',
    data:user
  })
}


/**
 * 根据token获取用户信息
 * @param token
 * @returns {AxiosPromise}
 */
export function getInfo(token) {
  return request({
    url: '/service-user/user/getInfoByToken',
    method: 'post',
    params: { token }
  })
}

/**
 * 获取所有用户信息
 * @param current
 * @returns {AxiosPromise}
 */
export function selectAllUser(current) {
  return request({
    url: '/service-user/user/selectAllUser',
    method: 'post',
    params:{
      current
    }
  })
}

/**
 * 删除用户信息
 * @param user
 * @returns {AxiosPromise}
 */
export function deleteUser(userId) {
  return request({
    url: '/service-user/user/deleteUser',
    method: 'post',
    params:{
      userId
    }
  })
}
